<DOCTYPE html>
<html>
<head>
    <title><?php echo $store_info[0]['store_name']; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php foreach ($this->config->item('style_css_paths') as $css): ?>
      <link rel="stylesheet" href=<?php echo $css ?> />
    <?php endforeach ?>
    <?php foreach ($this->config->item('style_js_paths') as $js): ?>
      <script type="text/javascript" src=<?php echo $js?> ></script>
    <?php endforeach ?>
    <script type="text/javascript" src=<?php echo base_url("/scripts/logic/uihelper.js") ;?>></script>
</head>
<body>
    <div data-role="page" id="store_<?php echo $store_id; ?>" class="store" store_id="<?php echo $store_id; ?>" store_name="<?php echo $store_info[0]['store_name']; ?> " store_bottom_price="<?php echo $store_bottom_price['store_bottom_price']; ?> "> 
        <div data-role="header" data-tap-toggle="false" data-theme="a"  data-position="fixed">
            <a href=<?php echo site_url("welcome/shop") ;?> class="ui-btn">返回</a>
            <h1><?php echo $store_info[0]['store_name']; ?></h1>
            <div data-role="controlgroup" data-type="horizontal" class="ui-mini ui-btn-right">
                <a id="clear_bill" class="ui-btn ui-btn-a ui-btn-icon-right ui-icon-delete">清空</a>
                <a href=<?php echo site_url("welcome/generalPay") ;?> id="store_pay" class="ui-btn ui-btn-b ui-btn-icon-right ui-icon-check">下单</a>
            </div>
        </div> 
        <div role="main" class="ui-content">
             <div class="" >
              <div class="ui-bar ui-bar-a">
                <h3>店铺说明</h3>
              </div>
              <div class="ui-body ui-body-a">
                <p><?php echo $store_info[0]['store_note']; ?></p>
              </div>
            </div>


            <div data-role="collapsibleset" >
                <?php $item_type = "分类" ; $type_counter = 0;?>
                <?php foreach ($item_list as $item): ?>
                    <?php 
                        // 判断是否添加分类
                        if ($item["item_type"] != $item_type)
                        {
                            $item_type = $item["item_type"];
                            if ($type_counter != 0)
                            {
                                echo '</ul>';
                                echo "</div>";
                            }
                            echo '<div data-role="collapsible" ><h2>' . $item_type . "</h2>";
                            echo '<ul data-role="listview" data-split-icon="minus" data-inset="true">';
                            $type_counter = $type_counter + 1;
                        }
                    ?>

                    <li class="item" 
                         item_id="<?php echo $item['item_id']; ?>" 
                         item_price="<?php echo $item['item_price'] ;?>"
                         item_name="<?php echo $item['item_name'] ;?>"    >

                         <a class="add" href="#">
                            <?php 
                                if ($item['show_pic'] == 0)
                                {
                                    ?>
                                    <img src="<?php echo base_url($item['item_pic'])?>">
                                    <?php
                                }
                            ?>
                            
                            <h2><?php echo $item['item_name'] ;?></h2><p class="ui-li-aside"></p>
                            <p><?php echo $item['item_price'] ;?>元</p>
                            <p><?php echo $item['item_note']  ;?></p>
                            <span class="ui-li-count item_account" id="item_account_id_<?php echo $item['item_id']; ?>">0</span>
                        </a>
                        <a href="#" class="del" data-transition="pop" data-position-to="window" data-transition="pop">Purchase</a>
                    </li>

                <?php endforeach ;
                    if ($type_counter > 0)
                    {
                        echo "</div>";
                    }
                ?>
            </div>

            <div>
                <a id="store_pay_no_use" href=<?php echo site_url("welcome/generalPay") ;?> class="ui-shadow ui-btn ui-btn-b" >马上下单！</a>
            </div>

        </div>   
        <div data-role="footer" data-tap-toggle="false" data-position="fixed">
            <div data-role="navbar">
              <ul>
                <li><a href=<?php echo site_url('welcome');?> data-icon="home">主页</a></li>
                <li><a href=<?php echo site_url("welcome/shop") ;?> data-icon="shop" class="ui-btn-active ui-state-persist">店铺</a></li>
                <li><a href=<?php echo site_url('welcome/history');?>  data-icon="check">历史订单</a></li>
                <li><a href=<?php echo site_url("welcome/info") ;?> data-icon="info">个人信息</a></li>
              </ul>
            </div>
        </div>
    </div>














</body>
</html>